home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / blix / aiff.h next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  2.3 KB  |  92 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*______________________________________________________________________
  18.  |
  19.  | aiff.h - audio header file
  20.  |
  21.  |
  22. */
  23.  
  24. /*
  25.  * AIFF format header file
  26.  * bytes are stored in 68000 = big endian order
  27.  */ 
  28.  
  29. /*
  30.  * some of the audio parameters in an AIFF file
  31.  */
  32. typedef struct
  33. {
  34.     long samprate;
  35.     long nchannels;
  36.     long sampwidth;
  37. } audio_params_t;
  38.  
  39. /*
  40.  * all chunks consist of a chunk header followed by some data
  41.  *
  42.  * WARNING: the spec says that every chunk must contain an even number 
  43.  * of bytes. A chunk which contains an add number of bytes is padded with
  44.  * a trailing zero byte which is NOT counted in the chunk header's size
  45.  * field.
  46.  */
  47. typedef struct
  48. {
  49.     char id[4];
  50.     long size;
  51. } chunk_header_t;
  52.  
  53. #define CHUNK_ID     4
  54. #define CHUNK_HEADER 8
  55.  
  56. typedef struct
  57. {
  58.     chunk_header_t header;
  59.     int file_position;  /* not in AIFF file */
  60.     char type[4]; /* should contain 'AIFF' for any audio IFF file */
  61. } form_chunk_t;
  62.  
  63. #define FORM_CHUNK      12  /* including the header */ 
  64. #define FORM_CHUNK_DATA 4   
  65.  
  66. #define COMM_CHUNK      26   /* including the header */
  67. #define COMM_CHUNK_DATA 18
  68.  
  69. typedef struct
  70. {
  71.     chunk_header_t header;
  72.     int file_position;            /* not in AIFF file */
  73.     short nchannels;
  74.     unsigned long nsampframes;
  75.     short sampwidth;
  76.     long samprate;              /* not in AIFF file */
  77. } comm_chunk_t;
  78.  
  79.  
  80. #define SSND_CHUNK      16   /* including the header */
  81. #define SSND_CHUNK_DATA 8
  82.  
  83. typedef struct
  84. {
  85.     chunk_header_t header;
  86.     unsigned long offset;
  87.     unsigned long blocksize;
  88.  
  89.     long file_position; /* not in AIFF file */
  90.     long sample_area_bytes; /* not in AIFF file */
  91. } ssnd_chunk_t;
  92.